package model

import (
	"database/sql"
	"time"
)

type DjangoContentType struct {
	Id       int    `db:"id"`
	AppLabel string `db:"app_label"`
	Model    string `db:"model"`
}

func (d *DjangoContentType) TableName() string {
	return "django_content_type"
}

type DjangoMigrations struct {
	Id      int    `db:"id"`
	App     string `db:"app"`
	Name    string `db:"name"`
	Applied string `db:"applied"`
}

func (d *DjangoMigrations) TableName() string {
	return "django_migrations"
}

type DjangoSession struct {
	SessionKey  string    `db:"session_key"`
	SessionData string    `db:"session_data"`
	ExpireDate  time.Time `db:"expire_date"`
}

func (d *DjangoSession) TableName() string {
	return "django_session"
}

type DjangoSite struct {
	Id     int    `db:"id"`
	Domain string `db:"domain"`
	Name   string `db:"name"`
}

func (d *DjangoSite) TableName() string {
	return "django_site"
}

type AuthPermission struct {
	Id            int    `db:"id"`
	Name          string `db:"name"`
	ContentTypeId int    `db:"content_type_id"`
	Codename      string `db:"codename"`
}

func (a *AuthPermission) TableName() string {
	return "auth_permission"
}

type DjangoAdminLog struct {
	Id            int            `db:"id"`
	ActionTime    time.Time      `db:"action_time"`
	ObjectId      sql.NullString `db:"object_id"`
	ObjectRepr    string         `db:"object_repr"`
	ActionFlag    int            `db:"action_flag"`
	ChangeMessage string         `db:"change_message"`
	ContentTypeId sql.NullInt64  `db:"content_type_id"`
	UserId        int            `db:"user_id"`
}

func (d *DjangoAdminLog) TableName() string {
	return "django_admin_log"
}

type AuthGroupPermissions struct {
	Id           int `db:"id"`
	GroupId      int `db:"group_id"`
	PermissionId int `db:"permission_id"`
}

func (a *AuthGroupPermissions) TableName() string {
	return "auth_group_permissions"
}
